Repository navigation
Conversation
…obanov#98) llama-server's chunk provider called done() and then returned false, and cpp-httplib counted that as a cancelled response: it closed the connection right after one that advertised Keep-Alive. A client that reused it at once got a disconnect; Open WebUI agent chats stopped after their first tool call with "Server Connection Error". patches/0023 returns true once the body is complete, as suggested in cobanov#98, so cpp-httplib itself stays unpatched. A failed final write still fails: cpp-httplib checks it before the provider's result. tests/server_stream_keepalive_test.py, run by scripts/test-fleet.sh, sends two streams and then a plain request over one connection on chat, messages, responses and completion. Applied on llama.cpp 970b51c after patches 0001-0018 and patches/fleet; a second pass of scripts/apply-patches.sh skips it. On macOS the test passes, and without the change the server closes the connection after the first stream. With the same end handled in cpp-httplib (memfix8), a 45+ tool-call Open WebUI agent turn ran on the console without a disconnect. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Dem3SmAW35vh3Kc6DxfxPm
cobanov
requested changes
Nov 25, 2026
cobanov
left a comment
Owner
There was a problem hiding this comment.
Thanks @MCsumz, and thanks for fixing it in the provider. You found exactly the right line. llama.cpp made the same fix upstream on Nov 14 (ggml-org/llama.cpp#30492, cf9a9957d), and #103 brought it in this morning. So 0023 no longer applies on main, and merged as it is, this PR would stop the build.
- Please drop
patches/0023-stream-end-keeps-connection.patch. - Keep
tests/server_stream_keepalive_test.pyand its line inscripts/test-fleet.sh. Upstream's test covers only/completion, so this is a good guard on four endpoints. Its docstring should point at the upstream fix instead of 0023. - Reword the CHANGELOG entry: the fix comes with the llama.cpp move (ggml-org/llama.cpp#30492), and the test guards it. Please also wrap the long line.
After that it's a quick merge.
The llama.cpp move (cobanov#103, d2bceda3d) carries ggml-org/llama.cpp#30492 (cf9a9957d), which makes the chunk provider return true after done(), so patches/0023 no longer applies and is dropped. The test stays, on all four endpoints (upstream's covers only /completion), with its docstring pointing at the upstream fix; the CHANGELOG entry says the same and is wrapped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Done in 170624c, merged with main:
Console check on main 5e96235 without the patch: PS5 Pro, Qwen 3.8 27B UD-Q2_K_XL, an Open WebUI agent chat with 6 tool calls and two follow-ups. No dropped connections. BR Marcell |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Second from #98. The fix itself now comes with the llama.cpp move (#103, d2bceda3d), which carries ggml-org/llama.cpp#30492 (cf9a9957d): the provider returns true after
done(). Sopatches/0023is dropped, and this PR keeps only the test that guards it.Before that fix, the provider called
done()and then returned false, and cpp-httplib counted that as a cancelled response: it closed the connection right after one that advertisedKeep-Alive. A client that reused it at once got a disconnect; Open WebUI agent chats stopped after their first tool call with "Server Connection Error".tests/server_stream_keepalive_test.py(new, intest-fleet.sh): two streams, then/health, on one connection; chat, messages, responses, completion/completion🤖 Generated with Claude Code